/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ShahanThai
 */
@Entity
@Table(name = "Musicians", catalog = "SharingMusic", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Musicians.findAll", query = "SELECT m FROM Musicians m"),
    @NamedQuery(name = "Musicians.findByMusicianID", query = "SELECT m FROM Musicians m WHERE m.musicianID = :musicianID"),
    @NamedQuery(name = "Musicians.findByMusicianName", query = "SELECT m FROM Musicians m WHERE m.musicianName = :musicianName")})
public class Musicians implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "MusicianID", nullable = false)
    private int musicianID;
    @Basic(optional = false)
    @Column(name = "MusicianName", nullable = false, length = 50)
    private String musicianName;
    @OneToMany(mappedBy = "musicians")
    private List<Songs> songsList;

    public Musicians() {
    }

    public Musicians(int musicianID) {
        this.musicianID = musicianID;
    }

    public Musicians(int musicianID, String musicianName) {
        this.musicianID = musicianID;
        this.musicianName = musicianName;
    }

    public Musicians(String musicianName) {
        this.musicianName = musicianName;
    }

    public int getMusicianID() {
        return musicianID;
    }

    public void setMusicianID(int musicianID) {
        this.musicianID = musicianID;
    }

    public String getMusicianName() {
        return musicianName;
    }

    public void setMusicianName(String musicianName) {
        this.musicianName = musicianName;
    }

    public List<Songs> getSongsList() {
        return songsList;
    }

    public void setSongsList(List<Songs> songsList) {
        this.songsList = songsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash = this.musicianID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Musicians)) {
            return false;
        }
        Musicians other = (Musicians) object;
        if (this.musicianID != other.musicianID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.Musicians[musicianID=" + musicianID + "]";
    }

}
